<?php

namespace Shop\IndexBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

use Shop\AdminBundle\Entity\User;

/**
 * Class LoginController
 * @package Shop\IndexBundle\Controller
 * @Route("/login")
 */

class LoginController extends Controller
{
    /**
     * @Route("/")
     * @Template()
     */
    public function indexAction()
    {
        $user = new User();

        $form = $this->createFormBuilder($user)
            ->add('phone')
            ->add('password', null)
            ->add('save', 'submit')
            ->getForm();

        if($form->isValid()){

        }

        return $this->render('ShopIndexBundle:Login:index.html.twig', array(
            'form' => $form->createView(),
        ));
    }

    /**
     * @Route("/check")
     * @Template()
     */
    public function checkAction(Request $request){
        print_r($request);exit;
    }

}
